//
//  DYJiudianDetailSubCell.swift
//  SheYangBigData
//
//  Created by 宋海胜 on 2021/1/11.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit

enum JiudianDetailType {
    case black
    case gray
}

class DYJiudianDetailSubCell: SYBaseCell {

    

    var bgView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = UIColor(hex: 0x888888)
        v.layer.cornerRadius = 2.5.autoWidth()
        return v
    }()
    
    let nameLb: UILabel = {
        let v:UILabel = UILabel()
        v.numberOfLines = 0
        return v
    }()
    
    let pic: UIImageView = {
        let v: UIImageView = UIImageView()
        
        v.image = UIImage(named: "ertong")
        return v
    }()
    
    var type:JiudianDetailType = .black {
        didSet {
            if type == .black {
                nameLb.textColor = UIColor(hex: 0x333333)
                nameLb.font = UIFont.systemFont(ofSize: 13)
                pic.isHidden = false
                bgView.isHidden = true
            } else {
                nameLb.textColor = UIColor(hex: 0x888888)
                nameLb.font = UIFont.systemFont(ofSize: 13)
                pic.isHidden = true
                bgView.isHidden = false
            }
        }
    }
    
    override func initViews() {
        
        addSubview(bgView)
        addSubview(nameLb)
        addSubview(pic)
        pic.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(16)
            make.width.height.equalTo(17)
            
        }
        nameLb.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(pic.snp.right).offset(5)
            make.right.equalTo(self.snp.right).offset(-15)
//            make.height.equalTo(17.autoWidth())
            make.top.equalToSuperview().offset(7.0)
            make.bottom.equalToSuperview().offset(-7.0)
        }
        bgView.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(self).offset(17)
            make.height.width.equalTo(5)
        }
    }
}


class DYJiuDianBiduView: SYBaseView {
    
    let nameLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0xFFA800)
        v.font = 15.autoBoldFontSize()
        v.text = "预定必读"
        return v
    }()
    
    let pic: UIImageView = {
        let v: UIImageView = UIImageView()
        v.image = UIImage(named: "tanhao_bidu")
        return v
    }()
    
    override func initViews() {
        
        addSubview(nameLb)
        addSubview(pic)
        pic.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(15.autoWidth())
            make.width.height.equalTo(18.autoWidth())
        }
        nameLb.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(pic.snp.right).offset(6.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
       
    }
}



class DYJiuDianZhengceView: SYBaseView {
    
    let nameLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x1E1E1E)
        v.font = 15.autoBoldFontSize()
        v.text = "政策"
        return v
    }()
    
    
    
    override func initViews() {
        
        addSubview(nameLb)
        
        nameLb.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(self).offset(15.autoWidth())
            make.height.equalTo(15.autoWidth())
        }
       
    }
}
